﻿@using Quiz.Model;
@using Quiz.Player.Controllers;
@model Quiz.Model.AnswerSet

@{
    ViewBag.Title = "Create";
    ViewBag.Menu = "Play.Index";
    MCQ4 atp = MCQ4.A;
    try
    {
        if (Model == null || !char.IsLetter(Model.Position))
        {
            atp = (MCQ4)Enum.Parse(typeof(MCQ4), Model.Position.ToString());
        }
    }
    catch
    {
    }

}

<h2>Create Answer</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>&nbsp;</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.QuestionID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.QuestionID)
            @Html.ValidationMessageFor(model => model.QuestionID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Position)
        </div>
        <div class="editor-field">
            @Html.DropDownList("Position", atp.ToSelectList(atp.ToString()))
          
            @Html.ValidationMessageFor(model => model.Position)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Text)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Text)
            @Html.ValidationMessageFor(model => model.Text)
        </div>

        <p>
            <input type="submit" value="Add Answer" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index", null, new { @class = "ui-btn-up-a" })
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
